package com.lyq.controller;

import com.lyq.service.DemoService;
import com.lyq.vo.TestGoodsInVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @className: DemoController
 * @description: demo
 * @author: XTJ
 * @date: 2023/05/26 14:18
 **/
@RestController
@RequestMapping({"/demo"})
public class DemoController {

    @Autowired
    private DemoService demoService;


    /**
     * 测试git信息
     */
    @PostMapping(value = "/importDemo")
    @ResponseBody
    public void importAddGoods(@RequestParam("file") MultipartFile multipartFile) throws IOException {
         demoService.importDemo(multipartFile);
    }


    /**
     * 导出
     */
    @PostMapping(value = "/exportDemo")
    @ResponseBody
    public void importAddGoods(@RequestBody TestGoodsInVo testGoodsInVo, HttpServletResponse response)  {
        demoService.exportTestGoodsInVo(testGoodsInVo,response);
    }


}
